package com.hele.sts.webwork;

public abstract class BaseAction
  extends PageAction
{
  public static final String LIST = "list";
  public static final String EDIT = "edit";
  public static final String UPDATE = "update";
  public static final String VIEW = "view";
  public static final String DELETE = "del";
  String action;
  
  public String execute()
    throws Exception
  {
    if ((this.action == null) || ("list".equalsIgnoreCase(this.action))) {
      return super.execute();
    }
    if ("update".equalsIgnoreCase(this.action)) {
      return update();
    }
    if ("view".equalsIgnoreCase(this.action)) {
      return view();
    }
    if ("edit".equalsIgnoreCase(this.action)) {
      return edit();
    }
    if ("del".equalsIgnoreCase(this.action)) {
      return delete();
    }
    return "none";
  }
  
  public abstract String update();
  
  public abstract String view();
  
  public abstract String edit();
  
  public abstract String delete();
  
  public String getAction()
  {
    return this.action;
  }
  
  public void setAction(String action)
  {
    this.action = action;
  }
}
